import Vue from 'vue'

const apiUrl = 'api/'

export default {
  getProvinces () {
    return Vue.http.get(apiUrl + 'province')
  },
  saveProvince (province) {
    if (!province.pkid) {
      return Vue.http.post(apiUrl + 'province/', province)
    } else {
      return Vue.http.put(apiUrl + 'province/', province)
    }
  },
  deleteProvince (pkid) {
    return Vue.http.delete(apiUrl + 'province/' + pkid)
  }
}
